<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>滑动</title>
    <style>
        #actress{
            width: 300px;
            height: 300px;
        }
    </style>
</head>
<body>
    <div id="sw">
        <label>
<!--            min最小值,max最大值 step 步长-->
            <input type="range" min="1" max="100" value="3" id="num" step="2">
        </label>
        <div id="tip"></div>
        <img src="img.png" alt="无法显示" id="actress">
    </div>
    <script>
        //1. 获取绑定对象,并保存在变量a中
        var a=document.getElementById("num");
        // 2.获取显示内容的div元素对象,并保存在变量b中
        var b=document.getElementById("tip");
        // 3.获取图片对象
        var c=document.getElementById("actress")
        // 绑定对象元素值改变
        a.onchange=function aa()
        {
            console.log(a.value)
            b.innerText=a.value
            switch (a.value){
                case "1":
                    console.log("今天天气很好");
                    break;
                case "2":
                    console.log("明天天气会很好");
                    break;
                case "5":
                    console.log("后天天气会很好");
                    break;
                case "39":
                    // 将图片显示置为none
                    c.style.display="none";
                    break;
                default:
                    console.log("选择出错")
                    break;
            }
        }
        for (i=0;i<10;i++){
            console.log(i)
        }

        var temp=0
        var s=0
        while (temp<10){
            console.log("第二次的值",temp)
            s+=temp++
        }
        console.log(s)
    </script>
</body>
</html>